<?php /*@var $tree Tree */?>
<?php if( !empty($arTree)): ?>

    <?php foreach( $arTree as $key => $tree ):?>
        <div class="menu_item" style="text-indent: <?php echo ($level * 10)?>px;">
            <?php echo link_to(
                            image_tag(
                                'arrow.png'
                                , array(
                                    'alt' => ''
                                    , 'class' => 'image_arrow'
                                )
                            ) . 
                          $tree['obj']->getName()
                          , 'tree/page?id=' . $tree['obj']->getId()
                          , array('class' => '')); ?>
        </div>
        <?php if(has_role_id(MyConstants::ROLE_ADMIN)): ?>
            <div class="meta_icon">
                <?php echo link_to(
                            image_tag(
                                'meta.png'
                                , array(
                                    'alt' => __('Edit meta')
                                    , 'title' => __('Edit meta')
                                )
                            )
                            , 'tree/meta?id=' . $tree['obj']->getId()
                            , array('class' => ''))?>
            </div>
        <?php endif; ?>
        <?php if( ($tree['obj']->getChildrenQnt() > 0) && ($level <=1) ): ?>
            <?php include_component('tree'
                                    , 'main_menu'
                                    , array('parent' => $tree['obj']->getId()
                                            , 'level' => $level+1) );?>
        <?php endif; ?>
    <?php endforeach;?>
<?php endif; ?>